home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13030 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: mail2news.demon.co.uk!tsys.demon.co.uk
  2. From: Tom Wheeley <tomw@tsys.demon.co.uk>
  3. Newsgroups: comp.lang.basic.misc,comp.lang.basic.visual.misc,comp.lang.c,comp.lang.c++,comp.os.ms-windows.apps.comm,comp.os.ms-windows.apps.word-proc,comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.tools.mfc,comp.windows.misc
  4. Subject: Re: Help finding contents of current directory.
  5. Date: Fri, 22 Mar 96 01:53:26 GMT
  6. Organization: City Zen FM
  7. Message-ID: <827459606snz@tsys.demon.co.uk>
  8. References: <4ho68l$qhi@ruby.digisys.net> <4hrjt1$jpr@news.microsoft.com> <3149D3CC.7D67@gate.net> <4icvkb$ogn@pinta.kolumbus.fi> <4in24g$ota@airdmhor.gen.nz>
  9. Reply-To: tomw@tsys.demon.co.uk
  10. X-NNTP-Posting-Host: tsys.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.30
  12. X-Sig-By: Tomsystems Quote v1.2.  (c)1996 Tom Wheeley, tomw@tsys.demon.co.uk
  13. X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!tsys.demon.co.uk
  14.  
  15. In article <4in24g$ota@airdmhor.gen.nz>
  16.            gumboot@airdmhor.gen.nz "Simon Hosie" writes:
  17.  
  18. > Dale Hollon (hollon@gate.net) wrote:
  19. > > I am trying to get a listing of the files in the current directory. I realize
  20. >  I will have to use 
  21. > > stat to determin wether it is a file or a directory.  But how do I find out
  22. >  what's in the 
  23. > > directory in the first place.
  24. > Tommi Ylikulju:
  25. > > I use _dos_findfirst and _dos_findnext functions to find out a listing of
  26. > > files in a specific directory. Check C documention for more info about  
  27. > > those functions.
  28. >   Umm, they're very DOSish functions.. are there not UNIXish functions that
  29. > do the same thing but are also supported by DOS compilers?
  30.  
  31. opendir, readdir and closedir
  32.  
  33. Similar to Findfirst and findnext under dos.
  34.  
  35. I doubt that you can use a construct directly accross unix/dos; you'll
  36. probably need some #ifdefs  :|
  37.  
  38. Maybe DJGPP supports the unix functions as is?  I doubt it, seeing as it is
  39. an OS call.  We can't expect DOS to be POSIX now, can we :)
  40.  
  41. .splitbung
  42. -- 
  43. * TQ 1.0 * The 'Just So Quotes'.
  44. Artificial Intelligence: the art of making computers that behave like the 
  45. ones in movies.
  46.     -- Bill Bulko
  47.